package masterjava.common.shared;

import java.io.Serializable;

/**
 * User: Grigory Kislin
 * Date: 27/06/11
 */
public class FetchContext implements Serializable {
    boolean cacheQueries = false;
    int firstResult = 0;
    int maxResults = 0;

    //TODO  implement at client/ server side
//    Map<String, FetchType> fetchTypes;
//    crit.setFetchMode ("Department", FetchMode.Join)

    public boolean isCacheQueries() {
        return cacheQueries;
    }

    public void setCacheQueries(boolean cacheQueries) {
        this.cacheQueries = cacheQueries;
    }

    public int getFirstResult() {
        return firstResult;
    }

    public void setFirstResult(int firstResult) {
        this.firstResult = firstResult;
    }

    public int getMaxResults() {
        return maxResults;
    }

    public void setMaxResults(int maxResults) {
        this.maxResults = maxResults;
    }

    @Override
    public String toString() {
        return "cacheQueries=" + cacheQueries +
                ", firstResult=" + firstResult +
                ", maxResults=" + maxResults;
    }
}
